import axios from "axios"
import request from "@/utils/request";
import {uploadAvatar, uploadUserFace} from "@/api/system/user";

// 登录方法
export function login(face) {
  const data = face
  return request({
    url: '/system/login',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

let base = '';
export const checkFace = (data) => {
  let config = {}
  config.data = data
  config.headers = {
    'Cache-Control': 'no-cache',
    'Content-Type': 'multipart/form-data'
  }
  config.transformRequest = data
  return axios.request({
    baseURL: process.env.BASE_API,
    method: 'post',
    url: '/system/login/loginByFace',
    ...config
  });
}

// 人脸登录方法
export function loginByFace(data) {
  return request({
    url: '/loginByFace',
    method: 'post',
    data: data
  })
}
